.. _`Quadratic Discriminant Analysis`: .. _`com.sympathyfordata.advancedmachinelearning.quadratic_discriminant_analysis`: Quadratic Discriminant Analysis ``````````````````````````````` .. image:: QDA.svg :width: 48 Constructs a quadratic classifier that separates two or more classes. Documentation ::::::::::::: Attributes ========== **covariance_** For each class, gives the covariance matrix estimated using the samples of that class. The estimations are unbiased. Only present if `store_covariance` is True. **means_** Class-wise means. **priors_** Class priors (sum to 1). **rotations_** For each class k an array of shape (n_features, n_k), where ``n_k = min(n_features, number of elements in class k)`` It is the rotation of the Gaussian distribution, i.e. its principal axis. It corresponds to `V`, the matrix of eigenvectors coming from the SVD of `Xk = U S Vt` where `Xk` is the centered matrix of samples from class k. **scalings_** For each class, contains the scaling of the Gaussian distributions along its principal axes, i.e. the variance in the rotated coordinate system. It corresponds to `S^2 / (n_samples - 1)`, where `S` is the diagonal matrix of singular values from the SVD of `Xk`, where `Xk` is the centered matrix of samples from class k. Definition :::::::::: Output ports ============ **model** model Model Configuration ============= **Covariance regularization parameter** (reg_param) Regularizes the per-class covariance estimates by transforming S2 as ``S2 = (1 - reg_param) * S2 + reg_param * np.eye(n_features)``, where S2 corresponds to the `scaling_` attribute of a given class. **Store covariance** (store_covariance) If True, the class covariance matrices are explicitly computed and stored in the `self.covariance_` attribute. .. versionadded:: 0.17 **Tolerance** (tol) Absolute threshold for the covariance matrix to be considered rank deficient after applying some regularization (see `reg_param`) to each `Sk` where `Sk` represents covariance matrix for k-th class. This parameter does not affect the predictions. It controls when a warning is raised if the covariance matrix is not full rank. .. versionadded:: 0.17 Examples ======== * :download:`Fisher_faces.syx ` Implementation ============== .. automodule:: node_discriminant_analysis :noindex: .. class:: QuadraticDiscriminantAnalysis :noindex: